//品牌管理
$(function(){
	var id = ly.getUrlParam("id")||'';
	$('#taskList').getList({
		"initData":{
			"num":1,
			"size":10,
			"uid":id
		},
		ajaxform:true,
		"url":site.gateUrl+"/usersManagement/getTaskListByUid",// 数据请求url
		"type": "get",
		"checkname":"datachk", //选择器名称，为空不显示选择器
		"col":[  //数据列
			{"field":"taskName","display":"任务名称","width":"1.5"},
			{"field":"taskTypeDisplay","display":"任务类型","width":"1.5"},
			{"field":"taskLevelDisplay","display":"任务级别","width":"1.5"},
			{"field":"taskCategoriesDisplay","display":"任务类别","width":"1.5"},
			{"field":"taskStatusDisplay","display":"任务状态","width":"1.5"},
			{"field":"nickName","display":"发布人","width":"1.5"},
			{"field":"creatTime","display":"发布时间"}
		],
		"option":[ //操作按钮配置
			{"icon":"view","tip":"查看","fun":"view('{{id}}')"},  //icon: view,edit,add,del
//			{"icon":"edit","tip":"编辑","fun":"brandEdit('{{id}}')"},  // 花括号内可以对应相关字段
//			{"icon":"del","tip":"删除","fun":"deleteBrand('{{id}}')"}
		]
	});
	
	
	
	$("#taskType").getSelect({
		type:"screen",
		label:"任务类型：",
		asName:"taskType",
		code:"taskType"
	});
	$("#taskLevel").getSelect({
		type:"screen",
		label:"任务级别：",
		asName:"taskLevel",
		code:"taskLevel"
	});
	$("#taskCategories").getSelect({
		type:"screen",
		label:"任务类别：",
		asName:"taskCategories",
		code:"taskCategories"
	});
	
	//批量删除
	$("#batchDelBtn").click(function(){
		var c = "";
		$("input[name=datachk]:checked").each(function(){
			c += $(this).val()+',';
		});
		if(c!= null && c!=''){
			deleteBrand(c);
		}else{
			ly.toast("请选择删除项");
		}
	});
});

function view(id){
		ly.goto("task-view.html?id="+id+"&attendanceType=2")
	}
